module.exports = {
  async fetch({ args }) {
    let resp = await $http.get(`http://www.zxcs.me/map.html`)
    let html = resp.data
    const $ = cheerio.load(html)
    let list = $('li', '#content')
    let items = []
    list.each((index, li) => {
      let title = $('a', li).text()
      let url = $('a', li).attr('href')
      let id = url.match(/\d+/)[0]
      items.push({
        link: url,
        style: 'list',
        title: title,
        summary: '更新' + $('.riqi', li).text(),
        route: $route('download', {
          url: 'http://www.zxcs.me/download.php?id=' + id,
          id: id
        })
      })
    })
    return {
      items: items
    }
  }
}
